#include "searchpap.h"
#include "ui_searchpap.h"
#include "searchwin.h"
#include "paper.h"
#include <vector>
extern int n;
extern vector <paper*> pdata;
searchpap::searchpap(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::searchpap)
{
    ui->setupUi(this);
    ui->lineEdit->setText(pdata[n]->findtitle());
    ui->lineEdit_2->setText(pdata[n]->findid());
    ui->lineEdit_3->setText(pdata[n]->findtime());
    ui->lineEdit_4->setText(pdata[n]->findname());
    QString sta = QString::number(pdata[n]->findpage());
    ui->lineEdit_5->setText(sta);
    if(pdata[n]->ifsci()==1)
    ui->lineEdit_6->setText("是");
    else
    ui->lineEdit_6->setText("否");
    if(pdata[n]->ifei()==1)
    ui->lineEdit_7->setText("是");
    else
    ui->lineEdit_7->setText("否");
    if(pdata[n]->ifistp()==1)
    ui->lineEdit_8->setText("是");
    else
    ui->lineEdit_8->setText("否");
    if(pdata[n]->ifcorn()==1)
    ui->lineEdit_9->setText("是");
    else
    ui->lineEdit_9->setText("否");
    QString peo = pdata[n]->auther[0];
    for(unsigned int i =1;i<pdata[n]->auther.size();i++)
    {
        peo=  peo+","+pdata[n]->auther[i];
    }
     ui->textEdit->setText(peo);

}

searchpap::~searchpap()
{
    delete ui;
}


void searchpap::on_pushButton_clicked()
{
    this->close();
    searchwin *p  = new searchwin;
    p->show();
}
